package exam.huawei;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Scanner;

/**
 * @author chenhong
 * @version 1.0
 * @description TODO
 * @date 2023/4/16 15:02
 */
public class HJ19 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        HashMap<String, Integer> map = new HashMap<>();
        while (in.hasNext()) {
            String filePath = in.next();
            int errorNum = in.nextInt();
            String[] split = filePath.split("\\\\");
            String fileName = split[split.length - 1];
            if (fileName.length() > 16)
                fileName = fileName.substring(fileName.length() - 16);
            String key = fileName + " " + errorNum;
            if (map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            } else {
                map.put(key, 1);
            }
        }
        int count = 0;
        for (String string : map.keySet()) {
            count++;
            if (count > (map.keySet().size() - 8)) //输出最后八个记录
                System.out.println(string + " " + map.get(string));
        }
    }
}
